using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.VSPowerToys.Common.TaskManager
{
    public abstract class WindowsInstallerTask : Task
    {
        #region Private Members

        /// <summary>
        /// Location of Windows Installer based setup file
        /// </summary>
        private string setupFileLocation;

        private bool silentMode = true;

        private Dictionary<string, string> parameters = new Dictionary<string,string>();
        
        #endregion

        #region Public Properties

        /// <summary>
        /// Full path to setup file on the local computer
        /// </summary>
        public string InstallerLocation
        {
            get
            {
                return this.setupFileLocation;
            }
        }

        /// <summary>
        /// If set to true the setup process will launch in quiet mode.
        /// </summary>
        public bool RunInSilentMode
        {
            get
            {
                return this.silentMode;
            }

            set
            {
                this.silentMode = value;
            }
        }

        public override bool IsCancellable
        {
            get
            {
                return false;
            }
        }
        /// <summary>
        /// Parameters that will be sent to the setup process
        /// </summary>
        public Dictionary<string, string> Parameters
        {
            get
            {
                return this.parameters;
            }
        }

        #endregion
        
        #region Constructors

        /// <summary>
        /// Creates a new Windows Installer based setup task for the specified file
        /// </summary>
        /// <param name="location">Full path to the setup file to install</param>
        protected WindowsInstallerTask(string setupLocation)
            : base(setupLocation)
        {
            this.setupFileLocation = setupLocation;
        }
        
        #endregion
    }
}
